package com.heima.admin.controller;

import com.heima.admin.service.IArticleModerationService;
import com.heima.model.admin.dtos.NewsAuthDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.AuthDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/api/v1/auth/")
public class ArticleModerationController {

    @Autowired
    private IArticleModerationService iArticleModerationService;


    /**
     * 通过feign去查询ApUserRealname表里面的分页数据
     * @param authDto
     * @return
     */
    @PostMapping("/list")
    public ResponseResult listApUserRealname(@RequestBody AuthDto authDto) {
        ResponseResult listApuser = iArticleModerationService.listApUserRealname(authDto);
        return listApuser;
    }
    /**
     * 审核失败
     * @param authDto
     * @return
     */
    @PostMapping("/authFail")
    public ResponseResult auditFail(@RequestBody AuthDto authDto){
        ResponseResult responseResult = iArticleModerationService.auditFail(authDto);
        return responseResult;
    }

    /**
     * 审核成功
     * @param authDto
     * @return
     */
    @PostMapping("/authPass")
    public ResponseResult authPass(@RequestBody AuthDto authDto) {
        ResponseResult authPass = iArticleModerationService.authPass(authDto);
        return authPass;
    }



}
